running=`cat run`

if [[ $running -eq 1 ]]; then
   echo '有人正在发布 请稍后等待发布完成'
   exit;
fi

echo "1" > run

cd NexGen

echo "更新代码"
git pull

echo "编译"
mvn clean install -Dmaven.test.skip=true -pl www -am

echo "拷贝jar"
cp www/target/ng-www.jar ../ng-www.jar

echo "重启服务"

echo "重置运行状态"
echo "0" > ../run

sh ../restart.sh 
